<div class="list">
<span class="txt"><a class="ajax" href='javascript:void(0);'></a></span>
	<table cellspacing="0" cellpadding="0" align="center">
		<tr class="th">
			<th>ID</th>	
			<th>图片名称</th>
			<th>图片分类</th>
			<th>所属项目</th>
                        <th>资源路径</th>
                        <th>alt</th>
                        <th>url</th>
                        <th>sortID</th>
			<th>操作</th>	
		</tr>
		<?php foreach($images as $item):?>
		<tr class="bg">
			<td width="40"><?php echo $item['id'];?></td>
			<td width="150"><?php echo mb_substr($item['title'],0,10,'utf8');?></td>
			<td width="80"><?php echo service_type::getName($item['typeID']);?></td>
			<td width="120"><?php echo $item['itemID'];?></td>
                        <td width="100"><img src="<?php echo service_image::getThumb($item['src']);?>" /></td>
                        <td width="80"><?php echo $item['alt'];?></td>
                        <td width="80"><?php echo $item['url'];?></td>
                        <td width="40"><?php echo $item['sortID'];?></td>
			<td class="odd" width="110">
				<a class="ajax2" id="<?php echo $item['id'];?>" href="javascript:void(0);" >编辑</a>|
				<a class='del' id="<?php echo $item['id'];?>" href='javascript:void(0);' >删除</a>
			</td>
		</tr>

		<?php endforeach;?>
		<tr>
			<td colspan="8" height="30"><?php echo $page;?></td>
		</tr>

	</table>
</div>

<script type="text/javascript">
$(document).ready(function(){
	$(".bg:odd").css("background-color","#EDEDED");
	$(".ajax").mouseover(function(){
        id = $(this).attr('id');
        $(".ajax").wBox({requestType: "ajax",title:"BANNER添加",target:"<?php echo url('banner/add')?>"});
    });
	$(".ajax2").mouseover(function(){
        id = $(this).attr('id');
        $(".ajax2").wBox({requestType: "ajax",title:"单页修改",target:"<?php echo url('banner/edit?id=')?>"+id});
    });
	$(".del").click(function(){
		if(confirm("确认删除")){
			that = $(this);
			$.post("<?php echo url('banner/del');?>",{id:that.attr('id')},function(data){
				if(data.s==1){
					that.parents('tr').remove();
				}else{
					alert(data.i);
				}
			});
		}
		return false;
		});	
});
</script>
